<?php
class Job extends AppModel {
	var $name = 'Job';
	var $displayField = 'name';
	var $validate = array(
		'name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'user_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'EmployType'=>array(
			'className' =>'EmployType',
			'foreignKey' => 'employ_type_id'
			),
		'JobType'=>array(
			'className' =>'JobType',
			'foreignKey' => 'job_type_id'
			),
		'City'=>array(
			'className'=>'City',
			'foreignKey'=>'city_id'
			),
		'Language'=>array(
			'className'=>'Language',
			'foreignKey'=>'language_id'
			)
	);
	var $hasMany = array(
		'Comment' => array(
			'className' => 'Comment',
			'foreignKey' => 'commentable_id',
			'conditions' => array('commentable_type'=>'Job'),
			'dependent' => true
			
			)	
		);
}
?>